/*
 * ProfilePanel.java
 *
 * Created on September 28, 2008, 1:10 PM
 */
package no.eirikb.bomberman.applet.menu;

import no.eirikb.bomberman.applet.Bomberman;

/**
 *
 * @author  eirikb
 */
public class ProfilePanel extends javax.swing.JPanel {

    private Bomberman bomberman;

    /** Creates new form ProfilePanel */
    public ProfilePanel(Bomberman bomberman) {
        this.bomberman = bomberman;
        initComponents();

        nameLabel.setText("NAME: " + bomberman.getUser().getNick());
        characterLabel.setIcon(bomberman.getIdb().getCharacter().get(bomberman.getUser().getCharacter()).getRight().get(0));
        for (String s : bomberman.getIdb().getCharacter().keySet()) {
            characterComboBox.addItem(s);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        nameLabel = new javax.swing.JLabel();
        characterLabel = new javax.swing.JLabel();
        characterComboBox = new javax.swing.JComboBox();
        saveButton = new javax.swing.JButton();

        setBackground(java.awt.Color.orange);

        nameLabel.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        nameLabel.setText("NAME"); // NOI18N

        characterLabel.setText(" "); // NOI18N

        saveButton.setText("SAVE"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nameLabel)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(characterLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(saveButton)
                            .addComponent(characterComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(325, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(nameLabel)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(characterLabel)
                    .addComponent(characterComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 192, Short.MAX_VALUE)
                .addComponent(saveButton)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox characterComboBox;
    private javax.swing.JLabel characterLabel;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JButton saveButton;
    // End of variables declaration//GEN-END:variables
}
